<template>
  <div class="article-type">
    <table class="table table-bordered  table-hover">
      <thead>
        <tr>
          <th style="width: 170px;text-align: center">类型</th>
          <th>类型描述</th>
          <th style="width: 170px;text-align: center">操作</th>
        </tr>
      </thead>
      <template v-for="item of items">
        <tr>
          <td class="text-center">{{item.artTypeName}}</td>
          <td>{{item.artTypeDesc}}</td>
          <td class="text-center ">
            <button class="btn btn-xs btn-success">编辑</button>
            <button class="btn btn-xs btn-danger">删除</button>
          </td>
        </tr>
      </template>
    </table>


  </div>
</template>

<style scoped>

  .table > thead > tr > th {
    background: #03B8CF;
    color: #fff;
  }

</style>

<script>

  import adminService from '@/service/adminService';
  export default{
    data(){
      return {
        items: []
      }
    },
    mounted(){
      this.getArtTypeList();
    },
    methods: {
      async  getArtTypeList(){
        let getList = await  adminService.getArticleType();
        console.log( getList )
        if ( getList.code ) {
          this.items = getList.data;
        }
      }
    }
  }
</script>
